#ifndef SENDUDP_H
#define SENDUDP_H

#include <QObject>
#include <QString>
#include <QDebug>
#include <QTimer>
#include <QtNetwork>

class sendudp : public QObject
{
    Q_OBJECT
public:
    explicit sendudp(QObject *parent = 0);
    ~sendudp();

public slots:
    void startBroadIP(int msec);
    void stopBroadIp();
    void broadMessage(const QString& msg);
    void setPort(const qint16& port);

private slots:
    void broadIP();

private:
    QUdpSocket* sender;
    qint16 udpPort;

    QTimer* send_time;

protected:
    QString getLocalHostIP() const;
};

#endif // SENDUDP_H
